#include "KnowledgeBaseMemoryFake.h"

Factory < KnowledgeBaseMemoryInterface > KnowledgeBaseMemoryFake::factory;

KnowledgeBaseMemoryFake::KnowledgeBaseMemoryFake ()
: typeRootAddress ( 0 )
, valueRootAddress ( 0 )
{
}

KnowledgeBaseMemoryFakePtr KnowledgeBaseMemoryFake::Spawn ()
{
	return factory.CreateNewObject < KnowledgeBaseMemoryFake > ();
}

void KnowledgeBaseMemoryFake::CheckInnocence ()
{
	assert ( factory.ObjectsCount () == 0 );
}

int KnowledgeBaseMemoryFake::ElementsCount ()
{
	return int ( elements.size () );
}

KnowledgeBaseElementInterfacePtr KnowledgeBaseMemoryFake::Element ( int index )
{
	return elements.at ( index );
}

void KnowledgeBaseMemoryFake::Append ( KnowledgeBaseElementInterfacePtr element )
{
	addedElements.push_back ( element );
}

void KnowledgeBaseMemoryFake::AppendTypeRoot ( KnowledgeBaseElementInterfacePtr element )
{
	addedElements.push_back ( element );
}

void KnowledgeBaseMemoryFake::AppendValueRoot ( KnowledgeBaseElementInterfacePtr element )
{
	addedElements.push_back ( element );
}

int KnowledgeBaseMemoryFake::TypeRootAddress ()
{
	return typeRootAddress;
}

int KnowledgeBaseMemoryFake::ValueRootAddress ()
{
	return valueRootAddress;
}
